﻿using System;
using System.Collections;
using System.Reflection;
using UploadClient.Interfaces.Upload;

namespace FtpUploadPlugin
{
    class Configuration : IUploadConfig
    {
        private readonly Hashtable settings;

        public Configuration()
            : this(new Hashtable())
        {
        }

        public Configuration(Hashtable settings)
        {
            this.settings = settings;
        }

        #region IUploadConfig Members

        public string UploadMethodName
        {
            get { return Assembly.GetExecutingAssembly().GetName().Name.ToString(); }
        }

        public string Version
        {
            get { return Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
        }

        public Guid Guid
        {
            get {
                return new Guid("1443BC10-38D8-419a-99D5-18B2F11C21D0");
                // ToDo: Propper cast
                //return (Guid)Assembly.GetEntryAssembly().GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), true).FirstOrDefault(); 
            }
        }

        public Hashtable Settings
        {
            get
            {
                return settings;
            }
        }

        #endregion
    }
}
